<%@ page import="com.vdm.model.UserInfo" %>
<%@ page import="com.vdm.util.Constants" %><%--
  Created by IntelliJ IDEA.
  User: 王鹏飞
  Date: 2020/7/16
  Time: 16:37
  如果访问到了根目录下的index.jsp页面，则跳转到 登录页面
--%>
<%
    UserInfo user = (UserInfo) request.getSession().getAttribute(Constants.CURRENT_USER);
    if (user == null) {
        System.out.println("user is null");
        response.sendRedirect(request.getContextPath() + "/user/toLogin");
    } else {
        response.sendRedirect(request.getContextPath() + "/user/toUserList");
    }
%>